<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%><%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<tiles:insertDefinition name="layout">
	<tiles:putAttribute name="head">
		<script type="text/javascript">
			$(function() {
				
				$(".date").datepicker({
					showWeek : true,
					firstDay : 1,
					dateFormat : 'yy-mm-dd',
					showOtherMonths : true,
					selectOtherMonths : true,
				});
				
				$("#save").click(function(){
					$.post('doImportExcel',$('#importForm').serialize(),function(data){
						alert("ok");
						document.location.href='importExcel?time='+(new Date()).getTime();
					});
				});

			});
		</script>
	</tiles:putAttribute>
	<tiles:putAttribute name="mainBody">
		<ul class="breadcrumb">
			<li><a href="listStudent">前台业务</a> <span class="divider">/</span></li>
			<li class="active">导入来访记录</li>
		</ul>
		<form method="post" action="importExcel" enctype="multipart/form-data" class="form-horizontal">
			<div class="control-group">
				<label class="control-label">文件上传</label>
				<div class="controls">
					<input name="excel" type="file" title="选择Excel文件" />
					<button type="submit" class="btn btn-primary">提交文件</button>
				</div>
			</div>
		</form>
		
		<div class="alert alert-block">
			点击”选择一个Excel文件“，提交一个形如
			<a href="#">XXX.xls</a>
			的Excel文件。然后再点击”提交文件“按钮，预览导来访记录。
		</div>
		<s:if test="#course_list.size > 0">
			<button id="save" class="btn btn-primary">保存</button>
			<span class="help-block">点击该按钮确认导来访记录</span>
		</s:if>
		<form action="doImportExcel" method="post" id="importForm">
		<table class="table">
			<thead>
				<tr>
					<th>NO</th>
					<th>日期</th>
					<th>时间</th>
					<th>姓名</th>
					<th>性别</th>
					<th>年龄</th>
					<th>电话</th>
					<th>前台</th>
					<th>cc</th>
					<th>type</th>
					<th>来源</th>
					<th>备注</th>
					<th>TMK OWNER</th>
				</tr>
			</thead>
			<tbody id="selectable">
				<s:iterator value="#rows" var="row" status="status">
					<tr class="lesson">
						<td>${status.index + 1}</td>
						<td><input name="name" class="input-mini" value="${row.date}" type="text"/></td>
						<td><input name="stuid" class="input-mini" value="${row.time}" type="text"/></td>
						<td><input name="signTime" class="input-small" value="${row.name }"/></td>
						<td><input name="cardId" class="input-small" value="${row.sex}" type="text"/></td>
						<td><input name="lessonCard" class="input-small" value="${row.age}" type="text"/></td>
						<td>
							<input  class="input-mini" name="" value="${row.phone }" type="text">
						</td>
						<td><input class="input-mini"  name="term" value="${row.front}" type="text"/></td>
						<td>
							<input class="input-mini"  name="term" value="${row.cc}" type="text"/>
						</td>
						<td>
							<input class="input-mini"  name="term" value="${row.type}" type="text"/>
						</td>
						<td><input name="beginTime" class="input-small"  value="${row.source }" type="text"/></td>
						<td><input name="endTime" class="input-small"  value="${row.note }" type="text"/></td>
						<td><input name="times"  class="input-mini"  value="${coure.tmkOwner}" type="text"/></td>
					</tr>
				</s:iterator>
			</tbody>
		</table>
		</form>
	</tiles:putAttribute>
</tiles:insertDefinition>